package com.yonyou.cloud.member.domainmodel.vo;

import com.yonyou.cloud.member.exceptions.ParameterException;

import java.time.LocalDateTime;

public class TimeRange {
    private LocalDateTime fromTime;
    private LocalDateTime toTime;

    public TimeRange(LocalDateTime fromTime, LocalDateTime toTime) {
        if (fromTime == null) {
            throw new ParameterException("from_time_required", "未传入从时间");
        }
        if (toTime == null) {
            throw new ParameterException("to_time_required", "未传入到时间");
        }
        this.fromTime = fromTime;
        this.toTime = toTime;
    }

    public LocalDateTime getFromTime() {
        return fromTime;
    }

    public LocalDateTime getToTime() {
        return toTime;
    }
}
